<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function (Blueprint $table) {
            $table->bigIncrements('id')->comment("自增id");
            $table->string("user_name")->comment("用户名")->unique()->index();
            $table->string("user_password")->comment("密码");
            $table->bigInteger('sex')->comment("性别");
            $table->bigInteger('age')->comment('年龄');
            $table->bigInteger("phone")->comment("手机")->unique();
            $table->text("img")->comment("头像");
            $table->timestamps();
            $table->engine = 'innoDB';
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_general_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}
